package com.ruoyi.common.core.domain;

import lombok.Data;

@Data
public class ResponseModel {

	private int code;
	private String msg;
	private Object data;
	private int count;


	public ResponseModel(int code, String msg, Object data, int count) {
		this.code = code;
		this.msg = msg;
		this.data = data;
		this.count = count;
	}
	public ResponseModel(int code, String msg, Object data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	public static ResponseModel Ok(Object data,int count){
		return new ResponseModel(200,"成功",data,count);
	}
	public static ResponseModel Ok(Object data){
		return new ResponseModel(200,"成功",data,0);
	}
	public static ResponseModel fail(String msg){
		return new ResponseModel(400,msg,null,0);
	}
	public static ResponseModel fail(Object data,String msg){
		return new ResponseModel(400,msg,data,0);
	}


}
